package com.itheima.chap04;

import com.itheima.chap03.DigitalProduct;
import com.itheima.chap03.PhysicalProduct;
import com.itheima.chap03.Product;

public class StaticFactoryMethod03 {
    public static void main(String[] args) {
//     PhysicalProduct p = new PhysicalProduct("华为Mate70",  7299.00,  672.00);
        PhysicalProduct p = Product.createPhysicalProduct("华为Mate70", 7299.00, 672.00);
        System.out.println(p.displayINfo());
//     DigitalProduct d = new DigitalProduct("百度云盘", 0.01, "123456");
        DigitalProduct d = Product.createDigitalProduct("百度云盘", 99.9, "123456");
        System.out.println(d.displayINfo());
    }
}
